<?php
// $Id$

/**
 * Controller_Shop 控制器
 */
class Controller_Shop extends Controller_Abstract
{
	function actionIndex()
	{
        // 检测分类 
		$this->page_size = 6;
		$this->union_table = Contents::meta();
		$this->lists(array('model'=>2,'status'=>1));
		// 加载产品分类
		$this->_view['good_category'] = Categorys::find('model = 2 and parentid = 106')->getAll();
	}
	function actionView()
	{
		$gid = intval($this->_context->gid);
		if (!$gid) header('location:'.url('default'));
		# 获取详细信息
		$data = Contents::find('model = 2 and id = ?',$gid)->getOne();
		if ($data->id())
		{ 
			$this->_view['data'] = $data;
		}else{
			return $this->_redirectMessage('出错啦!','没有找到您想要查找的信息',url('default'));
		}
	}
}